package pub.lichao.test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import pub.lichao.test.repository.TestDao;

import java.util.List;
import java.util.Map;

@Controller
public class StartController {
    @Autowired
    protected TestDao testDao;
    //添加四行注释
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public String index(Model model) {
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> is 第一次");
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> is 第二次");
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> is 第三次");
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> is 开发完毕，提交到远程分支");

        List<Map<String, Object>> queryResult = testDao.testQuery();
        System.out.println(queryResult);
        model.addAttribute("var", "hello world");
        model.addAttribute("queryResult", queryResult);
        return "index";
    }
}
